using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TerritoryDesignTools._Analysis
{
    /// <summary>
    /// <para>Solve Territories</para>
    /// <para>Creates and balances territories on the specified territory level provided that the balancing variables are set.</para>
    /// <para>在设置平衡变量的情况下，在指定的区域级别创建和平衡区域。</para>
    /// </summary>    
    [DisplayName("Solve Territories")]
    public class SolveTerritories : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SolveTerritories()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_territory_solution">
        /// <para>Input Territory Solution</para>
        /// <para>The territory solution that will be used to solve territories.</para>
        /// <para>将用于求解领土的区域解决方案。</para>
        /// </param>
        /// <param name="_level">
        /// <para>Level</para>
        /// <para>The level that will be used to solve territories.</para>
        /// <para>将用于解决领土的关卡。</para>
        /// </param>
        /// <param name="_method">
        /// <para>Number of Territories Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to calculate the number of territories.</para>
        ///   <bulletList>
        ///     <bullet_item>User Defined—The number of territories will be provided by the user. This is the default.</bullet_item><para/>
        ///     <bullet_item>Optimal—The number of territories will be calculated automatically.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于计算领土数的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>用户定义 - 用户将提供区域数。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>最佳 - 将自动计算区域数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public SolveTerritories(object _in_territory_solution, object _level, _method_value? _method)
        {
            this._in_territory_solution = _in_territory_solution;
            this._level = _level;
            this._method = _method;
        }
        public override string ToolboxName => "Territory Design Tools";

        public override string ToolName => "Solve Territories";

        public override string CallName => "td.SolveTerritories";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_territory_solution, _level, _method.GetGPValue(), _number_territories, _out_territory_solution, _quality];

        /// <summary>
        /// <para>Input Territory Solution</para>
        /// <para>The territory solution that will be used to solve territories.</para>
        /// <para>将用于求解领土的区域解决方案。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Territory Solution")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_territory_solution { get; set; }


        /// <summary>
        /// <para>Level</para>
        /// <para>The level that will be used to solve territories.</para>
        /// <para>将用于解决领土的关卡。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Level")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _level { get; set; }


        /// <summary>
        /// <para>Number of Territories Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to calculate the number of territories.</para>
        ///   <bulletList>
        ///     <bullet_item>User Defined—The number of territories will be provided by the user. This is the default.</bullet_item><para/>
        ///     <bullet_item>Optimal—The number of territories will be calculated automatically.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于计算领土数的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>用户定义 - 用户将提供区域数。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>最佳 - 将自动计算区域数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Territories Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _method_value? _method { get; set; }

        public enum _method_value
        {
            /// <summary>
            /// <para>User Defined</para>
            /// <para>User Defined—The number of territories will be provided by the user. This is the default.</para>
            /// <para>用户定义 - 用户将提供区域数。这是默认设置。</para>
            /// </summary>
            [Description("User Defined")]
            [GPEnumValue("USER_DEFINED")]
            _USER_DEFINED,

            /// <summary>
            /// <para>Optimal</para>
            /// <para>Optimal—The number of territories will be calculated automatically.</para>
            /// <para>最佳 - 将自动计算区域数。</para>
            /// </summary>
            [Description("Optimal")]
            [GPEnumValue("OPTIMAL")]
            _OPTIMAL,

        }

        /// <summary>
        /// <para>Number of Territories</para>
        /// <para>The number of territories to be specified.</para>
        /// <para>要指定的区域数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Territories")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _number_territories { get; set; } = null;


        /// <summary>
        /// <para>Updated Territory Solution</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Territory Solution")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_territory_solution { get; set; }


        /// <summary>
        /// <para>Quality (%)</para>
        /// <para>An integer between 1 and 200 that determines the performance of a solve operation. A lower value will provide better performance but quality may be affected. The default value is 100.</para>
        /// <para>介于 1 和 200 之间的整数，用于确定求解操作的性能。较低的值将提供更好的性能，但质量可能会受到影响。默认值为 100。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Quality (%)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _quality { get; set; } = null;


        public SolveTerritories SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}